<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>

		<title>日志列表</title>
		<link href="style/global.css" rel="stylesheet" type="text/css" />
		<link href="style/style.css" rel="stylesheet" type="text/css" />
		<sx:head />

		<%
			//全局变量设置，显示的文章日记字数
		%>
		<s:set name="begin" value="0"></s:set>
		<s:set name="end" value="150"></s:set>

		<style type="text/css">
<!--
#blogLayer {
	width: auto;
	height: auto;
	z-index: 1;
	left: 18px;
	top: 37px;
	border: 1px #b4e1f8 solid;
}

#blogLayerRightList {
	width: 308px;
	height: 220px;
	z-index: 1;
	left: 12px;
	top: 24px;
	border: 1px #b4e1f8 solid;
}

#blogLayerLeft {
	width: auto;
	height: auto;
	z-index: 1;
	left: 58px;
	top: 2px;
	border: 1px #b4e1f8 solid;
}

#blogLayerRight {
	width: auto;
	height: 263px;
	z-index: 2;
	left: 843px;
	top: 13px;
	border: 1px #b4e1f8 solid;
}

#userhomelayer {
	width: 1280px;
	height: auto;
	z-index: 1;
}

#middle {
	width: 1080px;
}

#bottom1 {
	margin-top: 30px;
}
-->
</style>

	</head>
	<body>

		<div id="userhomelayer" align="center">
			<div id="top"><%@include file="top.jsp"%></div>

			<div id="middle">

				<div id="blogLayer">
					<table>
						<tr>
							<td>
								<div id="blogLayerLeft">
									<table class="table1">
										<tr>
											<td colspan="4">
												<div align="left">
													&nbsp;&nbsp; 日志
												</div>
											</td>
										</tr>
										<tr>
											<c:if test="${empty list}">还没写文章哦！
						        </c:if>
										</tr>
										<s:iterator value="blogList.pageList" id="blog">
											<tr>
												<td></td>
											</tr>
											<tr>
												<td colspan="4">
													<div align="left">
														<a
															href="/blog/browseBlog.action?articleId=${blog.articleId}"
															target="_blank">${blog.articleTitle}</a>
													</div>
												</td>
											</tr>
											<tr>
												<td colspan="4">
													${blog.articlePublishDate}
												</td>
											</tr>
											<tr>
												<td colspan="4">
													<div align="left">
														&nbsp;&nbsp;&nbsp;&nbsp; ${blog.articleContent }

													</div>
												</td>
											</tr>
											<tr>
												<td width="160" class="smallfont">
													类别：
													<s:if test="#blog.voice==null">普通日志</s:if>
													<s:else>语音日志</s:else>
												</td>
												<td width="139" height="35" class="smallfont">
													<a
														href="/blog/browseBlog.action?articleId=${blog.articleId}"
														target="_blank">阅读（${blog.visitNumber}）</a>
												</td>
												<td width="111" class="smallfont">
													<a
														href="/blog/browseBlog.action?articleId=${blog.articleId}"
														target="_blank">评论(${fn:length(blog.comments)})</a>
												</td>
												<td width="223" class="smallfont">
													<a
														href="/blog/browseBlog.action?articleId=${blog.articleId}"
														target="_blank">阅读全文</a>
												</td>
											</tr>
											<tr>
												<td colspan="4" style="border-bottom: 1px #ffffff dashed">
													&nbsp;
												</td>
											</tr>
										</s:iterator>
										<c:if test="${! empty blogList.pageList }">
											<tr>

												<td colspan="3">
													<span class="pagerFont"> <s:if
															test="!blogList.isFirstPage()">
															<sx:a id="link1"
																href="page.action?page=first&account=%{user.account }"
																targets="blogLayerLeft">首页 </sx:a>

															<sx:a id="link3"
																href="page.action?page=previous&account=%{user.account }"
																targets="blogLayerLeft">上一页 </sx:a>
														</s:if> 共 <s:property value="blogList.getPageCount()" /> 页
														&nbsp;&nbsp; 当前第 <s:property value="blogList.getPage()+1" />页
														<s:if test="!blogList.isLastPage()">
															<sx:a id="link4"
																href="page.action?page=next&account=%{user.account }"
																targets="blogLayerLeft">下一页 </sx:a>
															<sx:a id="link2"
																href="page.action?page=last&account=%{user.account }"
																targets="blogLayerLeft">末页 </sx:a>
														</s:if> </span>

												</td>
											</tr>
										</c:if>
									</table>
								</div>
							</td>
							<td valign="top">
								<div id="blogLayerRight">
									<c:if test="${blogUser.account==user.account}">
										<div align="center">
											<a href="/blog/addBlog.jsp"><span>写新日志</span> </a>
										</div>
									</c:if>

									<div id="blogLayerRightList">
										共搜索到 ${searchSize } 篇日志
									</div>
								</div>
							</td>
						</tr>
					</table>
				</div>

			</div>

		</div>
		<div id="bottom1"><%@include file="bottom.jsp"%></div>
	</body>
</html>

